/******************************************************************************
 * @file     gpio_test_startup.c
 * @version  V0.10
 * $Revision: 1 $
 * $Date: 21/02/23 9:23a $
 * @brief    IEC60730 GPIO Test
 * @note
 * SPDX-License-Identifier: Apache-2.0
 * Copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved.
 ******************************************************************************/
#include "nuc980.h"
#include "sys.h"
#include "gpio.h"

#include "IEC60730_CONTROL_PARAM.h"
#include "IEC60730_SAFETY_TEST_LIB.h"

uint8_t IEC60730_GPIO_Test(void)
{

    /* DO */
    GPIO_SetMode(PA, BIT3, GPIO_MODE_OUTPUT);
    /* DI */
    GPIO_SetMode(PB, BIT7, GPIO_MODE_INPUT);

    /* DO */
    PA3 = 1;
    /* DI */
    if (PB7 != 1)
        return TEST_FAIL;

    /* DO */
    PA3 = 0;
    /* DI */
    if (PB7 != 0)
        return TEST_FAIL;

    return TEST_PASS;
}

/*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
